function [delta, expmu] = rcnl_meanval(Pi, rho, s_jt, xnonlin, cdindex, dfull, expmval_mat, replace, tolerance)

    tol   = tolerance;
    maxi  = 2500;
    mu    = (xnonlin * Pi) .* dfull;
    expmu = exp(mu);
    
    load(expmval_mat);
    expmval0(expmval0 < tol) = tol;
    [expmval, b, ~] = contrMap_rcnl_squarem(tol, maxi, log(expmval0), mu, cdindex, s_jt, rho);
    if max(b) > tol || sum(isnan(expmval)) > 0
        disp('WARNING: CONTRACTION MAPPING CONVERGENCE CRITERION FAILS');
    elseif replace
        expmval0 = expmval;
        save(expmval_mat, 'expmval0');
    end
    
    delta = log(expmval);
